package appClientModule;

import javax.smartcardio.CardException;
import javax.smartcardio.CardTerminal;
import javax.swing.event.EventListenerList;

public class CardRemoved implements Runnable {
	CardTerminal Reader;
	protected EventListenerList listenerList;

	public CardRemoved(CardTerminal reader) {
		this.Reader = reader;
		this.listenerList = new EventListenerList();
	}

	public void run() {
		try {
			this.Reader.waitForCardAbsent(0L);
			NotifyListeners();
		} catch (CardException localCardException) {
		}
	}

	protected void NotifyListeners() {
		Notify[] listeners = (Notify[]) this.listenerList.getListeners(Notify.class);
		for (int i = listeners.length - 1; i >= 0; i--)
			listeners[i].doneIt();
	}

	public void addNotifyListener(Notify l) {
		this.listenerList.add(Notify.class, l);
	}

	public void removeNotifyListener(Notify l) {
		this.listenerList.remove(Notify.class, l);
	}
}
